fix(API): hide SYSTEM_AUTHOR_ID from listAuthorsOfPad#7793
Merged
Conversation
Pad.SYSTEM_AUTHOR_ID ('a.etherpad-system') is the synthetic author
Etherpad attributes inserts to when the HTTP API receives a call
without authorId (setText, setHTML, appendText, the server-side
import flows, and plugins like ep_post_data). It exists so the
changeset's text and attribs stay in sync — without ANY author
attribute, pad.atext drifts and clients fail setDocAText
reconciliation when loading the pad. See Pad.ts:96-105 for the
full rationale.
That bookkeeping detail was leaking through listAuthorsOfPad: a
pad whose only "contributor" is the system author still reported
one authorID, which the existing tests in pad.ts and
appendTextAuthor.ts (and presumably any caller that uses
listAuthorsOfPad to count real users) treat as a real participant.
Filter SYSTEM_AUTHOR_ID at the API surface so internal attribution
stays internal. getAllAuthors() and downstream callers (copy,
anonymize, atext verification) keep seeing the synthetic id —
this only narrows the public listAuthorsOfPad response.
Fixes #7785
Fixes #7790
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoExclude SYSTEM_AUTHOR_ID from listAuthorsOfPad API response
WalkthroughsDescription• Filter synthetic SYSTEM_AUTHOR_ID from listAuthorsOfPad API response • Prevents internal bookkeeping detail from leaking to public API • Maintains SYSTEM_AUTHOR_ID visibility in internal attribution flows • Fixes test failures in pad.ts and appendTextAuthor.ts Diagramflowchart LR
A["listAuthorsOfPad API"] --> B["pad.getAllAuthors"]
B --> C["Filter SYSTEM_AUTHOR_ID"]
C --> D["Return real authors only"]
E["Internal flows"] --> F["Keep SYSTEM_AUTHOR_ID"]
File Changes1. src/node/db/API.ts
|
Code Review by Qodo
1.
|
Match the runtime behaviour from the previous commit — the synthetic 'a.etherpad-system' author used for unattributed inserts is filtered out of the listAuthorsOfPad response. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pad.SYSTEM_AUTHOR_ID('a.etherpad-system') is the synthetic author Etherpad attributes inserts to whenever the HTTP API or an internal flow inserts content without supplying anauthorId—setText/setHTML/appendTextwithoutauthorId, server-side imports, plugins likeep_post_data. The reason is that the changeset's text and attribs must stay in sync; without any author attribute,pad.atextdrifts and clients failsetDocATextreconciliation when loading the pad. SeePad.ts:96-105for the full rationale.That implementation detail was leaking through
listAuthorsOfPad. A pad whose only "contributor" is the system author was reporting one authorID, which the existing tests inpad.tsandappendTextAuthor.ts(and presumably any external caller usinglistAuthorsOfPadto count real users) treat as a real participant.Fix: filter
SYSTEM_AUTHOR_IDat the public API surface.getAllAuthors()and downstream callers (copy, anonymize, atext verification) keep seeing the synthetic id — this only narrows thelistAuthorsOfPadresponse.Why filter, not change attribution
I considered changing
Pad.appendCoreMsg/appendText/setTextto skip attribution when noauthorIdis supplied. That would break the changeset's text/attribs invariant —Pad.ts:96-105is explicit that the system author exists precisely to avoid that drift. The bug is in exposing the synthetic id, not in attributing to it.Test plan
Full backend sweep on a fresh develop clone (Node 24.14.0):
appendTextAuthor×1,importexportGetPost×2,pad.ts×3).pad.ts > Get Authors of the PadappendTextAuthor.ts > appendText without authorId does not attribute to any authorNote: these failures are invisible in CI today because of the broken backend-test glob — see #7789. Merging that is what makes CI actually run the affected tests.
Fixes #7785
Fixes #7790
🤖 Generated with Claude Code